<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="/opebs/date/css/bootstrap-datetimepicker.css">

<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="/opebs/date/js/bootstrap-datetimepicker.js"></script>

<link href="/lib/ueditor/themes/css/umeditor.css" type="text/css" rel="stylesheet">
<script type="text/javascript" charset="utf-8" src="/lib/ueditor/js/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/lib/ueditor/js/editor_api.js"></script>
<script type="text/javascript" src="/lib/ueditor/lang/zh-cn/zh-cn.js"></script>

 <link href="/bootstrap-fileinput-master/css/fileinput.css" media="all" rel="stylesheet" type="text/css"/>
<script src="/bootstrap-fileinput-master/js/fileinput.js" type="text/javascript"></script>
<script type="text/javascript" src="/lib/layer/2.4/layer.js"></script>

<body>
<form class="form-horizontal" id="form-meet-add" style="margin-top: 1%">

    <div class="form-group has-success">
        <label class="col-sm-2 control-label" for="inputSuccess">项目名称</label>
        <div class="col-sm-9">
            <input class="form-control" id="itemName" type="text"  value="<#if item??>${item.itemName!}</#if>">
        </div>
    </div>
    <div class="form-group has-success">
        <label class="col-sm-2 control-label" for="inputSuccess">项目投资时间</label>
        <div class="col-sm-9">
        <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" data-link-field="itemTime" data-link-format="yyyy-mm-dd">
            <input class="form-control" size="14" type="text" value="<#if item??>${item.itemTime!}</#if>" readonly>
            <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
        </div>
        <input type="hidden" id="itemTime" value="" />
        </div>
    </div>
    <div class="form-group has-success">
        <label class="col-sm-2 control-label" for="inputSuccess">
            投资金额
        </label>
        <div class="col-sm-9">
            <input class="form-control" id="itemMoney" type="text"  value="<#if item??>${item.itemMoney!}</#if>">
        </div>
    </div>

    <div class="form-group has-success">
        <label class="col-sm-2 control-label" for="inputSuccess">预计退出时间</label>
        <div class="col-sm-9">
            <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" data-link-field="itemOutTime" data-link-format="yyyy-mm-dd">
                <input class="form-control" size="14" type="text" value="<#if item??>${item.itemOutTime!}</#if>" readonly>
                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
            </div>
            <input type="hidden" id="itemOutTime" value="" />
        </div>
    </div>
    <div class="form-group has-success">
        <label class="col-sm-2 control-label" for="inputSuccess">
            预计收益(万)
        </label>
        <div class="col-sm-9">
            <input class="form-control" id="itemOutMoney" type="text"  value="<#if item??>${item.itemOutMoney!}</#if>">
        </div>
    </div>

    <div class="form-group has-success">
        <label class="col-sm-2 control-label" for="inputSuccess">
            备注
        </label>
        <div class="col-sm-9">
            <input class="form-control" id="itemCondition" type="text"  value="<#if item??>${item.itemCondition!}</#if>">
        </div>
    </div>


    <div class="form-group  has-success">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="button" id="save" class="btn btn-default">保存</button>
        </div>
    </div>
</form>
</body>
<script type="text/javascript">
    $('.form_date').datetimepicker({
        language:  'fr',
        weekStart: 1,
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0
    });
</script>
<script>
    var id = ${id};
    var localId = ${localId};

    $('#save').click(function () {
        var itemName = $('#itemName').val();
        var itemTime = $('#itemTime').val();
        var itemMoney = $('#itemMoney').val();
        var itemOutTime = $('#itemOutTime').val();
        var itemOutMoney = $('#itemOutMoney').val();
        var itemOutWay = $('#itemOutWay').val();
        var itemCondition = $('#itemCondition').val();

        $.ajax({
            url:"/jijinitem-ins-upd-del/"+localId,
            data:{itemCondition:itemCondition,itemName:itemName,itemTime:itemTime,itemMoney:itemMoney,proID:id,itemOutTime:itemOutTime,itemOutMoney:itemOutMoney,itemOutWay:itemOutWay},
            async: false,
            success: function(data) {
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            }
        })
    })
</script>
